package cn.huawei;

import java.util.*;

/*
@李子宁
Happy,happy everyday!
冲鸭！
2021/4/9

*/
class Person{
    //编号
    int num;
    int l;
    int r;

    Person(int num,int l,int r){
        this.num = num;
        this.l = l;
        this.r = r;
    }

}
public class Solutions {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = i + 1;
        }
        for (int i = 0; i < k; i++) {
            int l = in.nextInt();
            int r = in.nextInt();
            while(l-1 >=0 && r-1 < n && l < r ){
                int tmp = nums[l-1];
                nums[l-1] = nums[r-1];
                nums[r-1] = tmp;
                l ++; r--;
            }
        }

        for (int num : nums) {
            System.out.print(num + " ");
        }
    }


    /*public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        List<List<Integer>> res = new LinkedList<>();
        int n = in.nextInt();
        for (int i = 0; i < n; i++) {
            int times = 0;
            List<Integer> tmp = new LinkedList<>();
            List<Person> persons = new LinkedList<>();
            int nums = in.nextInt();
            for (int j = 0; j < nums; j++) {
                persons.add(new Person(j,in.nextInt(),in.nextInt()));
            }
            Collections.sort(persons,new Comparator<Person>() {
                @Override
                public int compare(Person o1, Person o2) {
                    if(o1.l == o2.l){
                        return o1.num - o2.num;
                    }else{
                        return o1.l - o2.l;
                    }
                }
            });
            times = persons.get(0).l;
            for (Person person : persons) {
                if(person.r < times){
                    tmp.add(0);
                }else{
                    tmp.add(times);
                    times = person.l + 1;
                }

            }
            res.add(tmp);

        }
        for (List<Integer> re : res) {
            System.out.println(re.toString().replace("[","").replace("]","").replace(",",""));
        }

    }*/
}
